import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { Toaster } from 'sonner'
import { ThemeProvider } from '@/contexts/ThemeContext'
import { AuthProvider } from '@/contexts/AuthContext'
import { LayoutContent } from '@/components/layout/LayoutContent'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
  title: '知识库管理系统',
  description: '知识库系统后台管理界面',
  keywords: ['知识库', '管理后台', '系统管理'],
  authors: [{ name: '知识库团队' }],
  viewport: 'width=device-width, initial-scale=1',
}

export default function AdminLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="zh-CN" suppressHydrationWarning>
      <body className={inter.className}>
        <ThemeProvider>
          <AuthProvider>
            <LayoutContent>
              {children}
            </LayoutContent>
            <Toaster 
              position="top-right"
              richColors
              closeButton
            />
          </AuthProvider>
        </ThemeProvider>
      </body>
    </html>
  )
}
